package com.heima.wemedia.controller.v1;

import com.baomidou.mybatisplus.extension.api.R;
import com.heima.model.admin.dtos.AdSensitiveDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.wemedia.service.WmNewsService;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/v1/sensitive")
public class SensitiveWordController {
    @Resource
    private WmSensitiveService wmSensitiveService;
    @PostMapping("/list")
    public ResponseResult getSensitiveWordList(){
        return wmSensitiveService.getSensitiveWordList();
    }
    @DeleteMapping("/del/{id}")
    public ResponseResult deleteSensitiveWordById(@PathVariable("id") Integer id){
        return wmSensitiveService.deleteSensitiveWordById(id);
    }

    @PostMapping("/save")
    public ResponseResult saveSensitiveWord(@RequestBody AdSensitiveDto dto){
        return wmSensitiveService.saveSensitiveWord(dto);
    }
    @PostMapping("/update")
    public ResponseResult updateSensitiveWordById(@RequestBody AdSensitiveDto dto){
        return wmSensitiveService.updateSensitiveWordById(dto);
    }
}
